<?php

namespace App\Http\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redis;
use App\Http\Model\AudioApi;


class ActivityPearl extends Base
{
    protected $table = 'activity_pearl_log';

    public function __construct(array $attributes = [])
    {
        parent::__construct($this->table, $attributes);
    }

    /*
         * 活动赠送商品记录
         * @param $user_id  赠送用户id
         * @param $award_value  赠送数量
         * @param activity_type  活动类型
         * @param $send_type  活动内赠送类型
         * @param $type  2金豆 1钻石 3亲密值
         * */
    public function create($user_id, $award_value, $activity_type, $send_type, $type = 2)
    {
        $data['user_id'] = $user_id ?? 0;
        $data['award_value'] = $award_value ?? 0;
        $data['activity_type'] = $activity_type ?? 1;
        $data['send_type'] = $send_type ?? 1;
        $data['type'] = $type ?? 2;
        return DB::table($this->table)->insert($data);
    }


}